<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<img src="img/ad.jpg" alt="">
<script>
    var img = document.querySelector('img');
    function callback() {
        img.style.display = 'none';
    }
    setTimeout(callback,5000);
</script>
</body>
</html>